package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class ConditionInformation implements SqlDiagnosticsInformation {

    private int beginIndex;
    private int endIndex;
    private boolean exception;
    private boolean condition;
    private SimpleValueSpecification conditionNumber;
    private ConditionInformationItemList conditionInformationItemList;

    public ConditionInformation(int beginIndex,
                                boolean exception,
                                boolean condition,
                                SimpleValueSpecification conditionNumber,
                                ConditionInformationItemList conditionInformationItemList) {
        this.beginIndex = beginIndex;
        this.endIndex = conditionInformationItemList.get(conditionInformationItemList.size() - 1).getEndIndex();
        this.exception = exception;
        this.condition = condition;
        this.conditionNumber = conditionNumber;
        this.conditionInformationItemList = conditionInformationItemList;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public boolean isException() {
        return exception;
    }

    public boolean isCondition() {
        return condition;
    }

    public SimpleValueSpecification getConditionNumber() {
        return conditionNumber;
    }

    public ConditionInformationItemList getConditionInformationItemList() {
        return conditionInformationItemList;
    }

}
